#include "log4qt_plugin.h"

#include <QDebug>
#include <QDateTime>
#include "log4qt_mgr.h"

#define DF_CUR_TIME_EX  QDateTime::currentDateTime().toString("yyyy-MM-dd hh:mm:ss.zzz")

/*
 * Function:    outputLog
 * Description: output data to the terminal
 * Paramer:     QtMsgType mgsType - the log type
 *              QString msgText - the message info
 * Return:      void
 */
void Log4qtPlugin::outputLog(QtMsgType mgsType, const QString & msgText)
{
    Log4qtMgr::GetInstance()->Output(mgsType, msgText);
}

/*
 * Function:    outputLog
 * Description: output data to the terminal
 * Paramer:     QtMsgType mgsType - the log type
 *              const QMessageLogContext & msgContext - the log context
 *              QString msgText - the message info
 * Return:      void
 */
void Log4qtPlugin::outputLog(QtMsgType mgsType, const QMessageLogContext & msgContext, const QString & msgText)
{
    Log4qtMgr::GetInstance()->Output(mgsType, msgContext, msgText);
}
